package ar.com.caeycae.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import ar.com.caeycae.data.Movimiento;
import ar.com.caeycae.service.MovimientoService;

@RestController
public class MovimientoController {

	public static final String MOVIMIENTOS = "/rest/movimientos";

	@Autowired
	private MovimientoService movimientoService;

	@RequestMapping(value = MOVIMIENTOS, method = RequestMethod.GET, produces="application/json")
	public @ResponseBody List<Movimiento> getAllMovimientos() {
		return movimientoService.listar();
	}
}
